<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	if($_RQ['merchid']){
		$_SESSION['merchid']=$_RQ['merchid'];
	}
	$return['ischecklogin']=model('jy_weishop/member')->checklogin('','','',$_SESSION['merchid'],true);
	$return['item']=model('jy_merch/member')->getdetail($_SESSION['merchid']);
	$return['member']=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','credit3','credit4','credit5','credit6','mobile','avatar','nickname'));
	$return['member']['sn']='NO'.sprintf("%09d", $_SESSION['uid']);
	$level= pdo_getcolumn('jy_weishop_member',array('merchid'=>$_SESSION['merchid'],'mid'=> $_SESSION['uid'], 'uniacid' => $_SESSION['uniacid']),'level');
	$return['member']['leveltitle']= pdo_getcolumn('jy_weishop_member_level',array('id'=>$level, 'uniacid' => $_SESSION['uniacid']),'title');
	$return['merch']= pdo_get('jy_merch_user',array('id'=>$_SESSION['merchid'], 'uniacid' => $_SESSION['uniacid']),array('id','merchname','mobile'));
	$return['ideal_money']=pdo_getcolumn('core_ideal_money',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),'money');
	$credit_types=credit_types();
	$credit_types2=array();
	foreach($credit_types as $key=>$value){
		$fee=$item['credit'.$key];
		$credit_types2[$key]=array(
			'id'=>$key,
			'title'=>$value,
			'fee'=>$fee
		);
	}
	$return['credit_types']=$credit_types2;
	$return['params']['type']=$_RQ['type']?:2;
	$status0 = pdo_count('jy_weishop_order',array('merchid'=>$_SESSION['merchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'status'=>0,'deleted'=>0,'userdeleted'=>0));
	$status1 = pdo_count('jy_weishop_order',array('merchid'=>$_SESSION['merchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'status'=>1,'deleted'=>0,'userdeleted'=>0));
	$status2 = pdo_count('jy_weishop_order',array('merchid'=>$_SESSION['merchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'status'=>2,'deleted'=>0,'userdeleted'=>0));
	$status3 = pdo_count('jy_weishop_order',array('merchid'=>$_SESSION['merchid'],'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'status'=>3,'iscomment'=>0,'deleted'=>0,'userdeleted'=>0));
	$cartnums= pdo_getsum('jy_weishop_member_cart',array('merchid'=>$_SESSION['merchid'],'mid'=> $_SESSION['uid'], 'uniacid' => $_SESSION['uniacid']),'total');
	$return['statics']=array(
		'status0'=>$status0,
		'status1'=>$status1,
		'status2'=>$status2,
		'status3'=>$status3,
		'cartnums'=>$cartnums
	);
	set_html('title','会员中心');
	exi($return);
}